<ion-view view-title="采购查询">
  <div class="bar bar-subheader" style="padding: 0;">
    <div class="item-input-inset crm-item-search">
      <label class="item-input item-input-wrapper ink">
        <i class="icon ion-search placeholder-icon"></i>
        <input type="text" placeholder="输入酒店名称、ID、地址" ng-model="purchase.search.value" ng-change="purchase.search.doAct()">
      </label>
    </div>
  </div>
  <ion-content class="crm-content has-tabs-top">
    <ion-refresher
            pulling-text="下拉刷新"
            on-refresh="purchase.refresh()">
    </ion-refresher>
    <ul class="list">
      <li class="item" ng-repeat="purch in purchase.data track by $index" ng-click="goDetailMain(purch)">
        <div class="row">
          <div class="col-67">
            <h2>{{purch.hotelName}}</h2>
            <p> {{purch.s_atime |  date:'yyyy-MM-dd hh:mm'}}</p>
            <p>{{purch.statusstr}}</p>
          </div>
          <div class="col-33 text-right">
            <p class="crm-color"> ￥{{purch.payment/100 | currency:""}}</p>
            <p>商品种数：{{purch.items.length}}</p>
          </div>
        </div>
      </li>
      <li class='item text-center' ng-if="purchase.loaded && purchase.data.length==0">
        <p>您负责的酒店还没有商城订单，<br>请您下次拜访酒店时，<br>向老板推荐我们的商城业务</p>
      </li>
    </ul>
    <ion-infinite-scroll
            ng-if="purchase.moreDataCanBeLoaded()"
            on-infinite="purchase.loadMore()"
            distance="5%"
            spinner="dots"
            immediate-check="false" >
    </ion-infinite-scroll>
  </ion-content>
</ion-view>
